VERSION 5.00
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} RCA_Form_Old 
   Caption         =   "RCA"
   ClientHeight    =   7800
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   14865
   OleObjectBlob   =   "RCA_Form_Old.frx":0000
   StartUpPosition =   1  'CenterOwner
End
Attribute VB_Name = "RCA_Form_Old"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub UserForm_Initialize()
  Dim ValLine As Integer
 
    ValLine = ActiveCell.Row

    RCA_Form.Label_RCA_File_Dir = Def_Col_RCA_TEMPLATEFILE_DIR
    RCA_Form.Label_RCA_File = "RCA " & Cells(ValLine, Def_Col_End_Customer).Value & " " & Cells(ValLine, Def_Col_Escalation_SR).Value & ".xls"
  
End Sub
Private Sub CommandButtonCreateFile_Click()
   Function_Create_RCA_File
      
End Sub

Private Sub CommandButtonClose_Click()
    Unload RCA_Form
End Sub

Function Function_Create_RCA_File()
  Dim SrceFile As String
  Dim DestFile As String
  Dim ValLine As Integer
  Dim tmp_ESC_SR, tmp_Custo_Name, tmp_Product, tmp_BusImp, tmp_ReasOfEsc, tmp_Les, tmp_Reco, tmp As String
  
  
    ValLine = ActiveCell.Row

    SrceFile = Def_Col_RCA_TEMPLATEFILE_DIR & Def_Col_RCA_TEMPLATEFILE
    DestFile = Def_Col_RCA_TEMPLATEFILE_DIR & "RCA " & Cells(ValLine, Def_Col_End_Customer).Value & " " & Cells(ValLine, Def_Col_Escalation_SR).Value & ".xls"
    FileCopy SrceFile, DestFile
    
    ' Avant d'ouvrir la nouvelle feuille il faut copier toutes les infos !!!
    tmp_ESC_SR = Cells(ValLine, Def_Col_Escalation_SR).Value
    tmp_Custo_Name = Cells(ValLine, Def_Col_End_Customer).Value
    tmp_Product = Cells(ValLine, Def_Col_Product).Value
    tmp_BusImp = "Issue: "
    tmp_ReasOfEsc = Cells(ValLine, Def_Col_Reason_Of_Escalade).Value & Chr(10) & "List of SR" & Chr(10)
    For j = 2 To Cells(65536, 1).End(xlUp).Row
        If Not Rows(j).Hidden Then
            If Cells(j, Def_Col_Escalation_SR).Value <> Empty Then
                    If Cells(j, Def_Col_Escalation_SR).Value = Cells(ValLine, Def_Col_Escalation_SR).Value Then
                        tmp_ReasOfEsc = tmp_ReasOfEsc & Cells(j, Def_Col_SR).Value & Chr(10)
                        tmp_ReasOfEsc = tmp_ReasOfEsc & "   " & GetContentsLine(Cells(j, Def_Col_Issue_Summary).Value, Chr(10), 0) & Chr(10)
                        tmp_BusImp = tmp_BusImp & " // " & GetContentsLine(Cells(j, Def_Col_Issue_Summary).Value, Chr(10), 0)
                    End If
            End If
        End If
    Next j
    
    tmp_Les = RCA_Form.TextBox_LD
    tmp_Reco = RCA_Form.TextBox_RA
    
  '' --------------------------------------
  Unload RCA_Form
  Unload Escalation_Entry_Form
  Unload Escalation_Management_Form
  '' --------------------------------------
    
    Workbooks.Open FileName:=DestFile
    
    ' ----------------
    ' Fill the File with all the SRs from this Escalation
    ' ----------------
    
    Range(Def_Col_RCA_ESCL) = "RCA " & tmp_ESC_SR
    Range(Def_Col_RCA_Author) = "Christian Klugesherz"
    Range(Def_Col_RCA_Date) = Now
    Range(Def_Col_RCA_CustomerName) = tmp_Custo_Name
    Range(Def_Col_RCA_Product) = tmp_Product
    Range(Def_Col_RCA_BusinessImpact) = tmp_BusImp
    Range(Def_Col_RCA_WhatCausedEscalation) = tmp_ReasOfEsc
    
    tmp = Replace(tmp_Les, Chr(10), " ")
    tmp = Replace(tmp, Chr(13), " ")
    tmp = Replace(tmp, Chr(9), "    ")
    Range(Def_Col_RCA_Lesson) = tmp
    
    tmp = Replace(tmp_Reco, Chr(10), " ")
    tmp = Replace(tmp, Chr(13), " ")
    tmp = Replace(tmp, Chr(9), "    ")
    Range(Def_Col_RCA_RecomAction) = tmp
    
    Range(Def_Col_RCA_Owner) = "R&D"
    Range(Def_Col_RCA_Process) = RCA_Form.Label_RCALessonType
    
 ' below code for saving and closing the workbook
 '  ActiveWorkbook.Save
 '  ActiveWorkbook.Close
    
End Function


'' =============================================================
''                    DEFINITON BUTTON
'' =============================================================

Private Sub OptionButtonLD1_Click()
    RCA_Form.TextBox_LD.Value = "SR well Handled"
End Sub

Private Sub OptionButtonLD2_Click()
    RCA_Form.TextBox_LD.Value = "Good reaction from both sides TS & R&D"
End Sub

Private Sub OptionButtonLD3_Click()
    RCA_Form.TextBox_LD.Value = "Nothing learned here." & vbNewLine & "Well handled because the right people have been involved from the beginning."
End Sub

Private Sub OptionButtonLD4_Click()
    RCA_Form.TextBox_LD.Value = "Once escalated, the SR has been quickly handled and a hot fix provided"
End Sub

Private Sub OptionButtonLD5_Click()
    RCA_Form.TextBox_LD.Value = "Even following the escalation the issue has not been well handled!"
End Sub

Private Sub OptionButtonLD6_Click()
    RCA_Form.TextBox_LD.Value = "It took too long time to resolve the issue !"
End Sub

Private Sub OptionButtonLD7_Click()
    RCA_Form.TextBox_LD.Value = "R&D had to provide several patches to get the final fix!"
End Sub

'' =============================================================

Private Sub OptionButtonRA1_Click()
    RCA_Form.TextBox_RA.Value = "In line with our SLA"
End Sub

Private Sub OptionButtonRA2_Click()
    RCA_Form.TextBox_RA.Value = "This escalation is on my point of view a good example of a well handled one." & vbNewLine & "In a short time the correction has been delivered and successfully installed at the customer site!" & vbNewLine & "Good job!"
End Sub

Private Sub OptionButtonRA3_Click()
    RCA_Form.TextBox_RA.Value = "The resolution for this escalation took to too long!" & vbNewLine & "It was difficult to get regular feedback."
End Sub

Private Sub OptionButtonRA4_Click()
    RCA_Form.TextBox_RA.Value = "Better reaction on R&D side would be expected for major cases and much better reaction if the SR is escalated!"
End Sub

Private Sub OptionButtonRA5_Click()
    RCA_Form.TextBox_RA.Value = "The communication was bad!" & vbNewLine & "Root cause identification took too long !"
End Sub

Private Sub OptionButtonRA6_Click()
    RCA_Form.TextBox_RA.Value = "We should not need an escalation to get reactions !"
End Sub

'' =============================================================
Private Sub OptionButton1_Click()
    RCA_Form.Label_RCALessonType.Caption = "Documentation"
End Sub

Private Sub OptionButton2_Click()
    RCA_Form.Label_RCALessonType.Caption = "Tools"
End Sub

Private Sub OptionButton3_Click()
    RCA_Form.Label_RCALessonType.Caption = "Training"
End Sub

Private Sub OptionButton4_Click()
    RCA_Form.Label_RCALessonType.Caption = "Process"
End Sub

